﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="List.aspx.cs" Inherits="Cn.Cellula.Website.Admin.Product.List" Title="产品列表" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script type="text/javascript" src="/jskit.org/Server/JskitXmlHttp.js"></script>

    <link type="text/css" rel="Stylesheet" href="/Cellula_Client/Controls/JskitFileUpload.css" />

    <script type="text/javascript" src="/Cellula_client/Controls/JskitFileUpload.js"></script>

    <link type="text/css" rel="Stylesheet" href="/Cellula_Client/Controls/Category.css" />

    <script type="text/javascript" src="/Cellula_client/Controls/CategoryFunc.js"></script>

    <script type="text/javascript">
        var jfu = new JskitFileUpload("jfu");
        jfu.setModeName("<%=ModelName %>");
        jfu.setFilePattern(".jpg|.png|.jpeg|.bmp|.gif");
        function showAlbum(sender){
            jfu.setModelKey(sender.getAttribute("pid"));
            jfu.display(sender.getAttribute("pname"));
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CPH_PageTitle" runat="server">
    产品管理
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="CPH_MainBody" runat="server">
    <div style="display: none;">
        <asp:Label runat="server" ID="lab_CategoryData"></asp:Label>

        <script type="text/javascript">
            var cfunc = new CategoryFunc("cfunc");
            cfunc.setData(CategoryData);
            function showMarket(sender){
                cfunc.panel.setModelKey(sender.getAttribute("pid"));
                cfunc.panel.setRequestUrl("Ws/_Action.aspx?id=36e5fa7d72ba4fd38b8b987d0627251b&parms=");
                cfunc.panel.showPanel(sender.getAttribute("pname"));
            }
        </script>

    </div>
    <fieldset>
        <legend>查询</legend>
        <table border="0" cellpadding="0" cellspacing="0" class="query_table">
            <tr>
                <td class="query_title">
                    产品名称：
                </td>
                <td class="query_content">
                    <asp:TextBox ID="txt_ProductName" runat="server" MaxLength="50"></asp:TextBox>
                </td>
                <td class="query_title">
                    产品分类：
                </td>
                <td class="query_content">
                    <asp:DropDownList runat="server" ID="ddl_Category">
                    </asp:DropDownList>
                </td>
                <td class="query_title">
                    有图片：
                </td>
                <td class="query_content">
                    <asp:DropDownList runat="server" ID="ddl_HasPic">
                    </asp:DropDownList>
                </td>
                <td class="query_title">
                    删除标记：
                </td>
                <td class="query_content">
                    <asp:DropDownList runat="server" ID="ddl_Del">
                        <asp:ListItem Value="0" Selected="True">正常</asp:ListItem>
                        <asp:ListItem Value="1">已删除</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="query_title">
                    规格/型号：
                </td>
                <td class="query_content">
                    <asp:TextBox ID="txt_Model" runat="server" MaxLength="50"></asp:TextBox>
                </td>
                <td class="query_title">
                    在售状态：
                </td>
                <td class="query_content">
                    <asp:DropDownList runat="server" ID="ddl_ListStatus">
                        <asp:ListItem Value="" Selected="True">-全部-</asp:ListItem>
                        <asp:ListItem Value="1">上架</asp:ListItem>
                        <asp:ListItem Value="0">未上架/已下架</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td class="query_title">
                    有卖场：
                </td>
                <td class="query_content">
                    <asp:DropDownList runat="server" ID="ddl_Marketplace">
                    </asp:DropDownList>
                </td>
                <td class="query_title">
                    最后更新：
                </td>
                <td class="query_content">
                    <asp:TextBox runat="server" ID="txt_StartDate" Width="80px" onclick="jskitDateSelector.open(this,event)"></asp:TextBox>
                    --
                    <asp:TextBox runat="server" ID="txt_EndDate" Width="80px" onclick="jskitDateSelector.open(this,event)"></asp:TextBox>
                </td>
            </tr>
        </table>
    </fieldset>
    <div class="action_bar">
        <asp:Button ID="btn_Query" runat="server" Text="查询" OnClick="btn_Query_Click" />
        &nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="btn_List" runat="server" Text="上架" OnClientClick="return acu.gv.checkMultiSelect(fixId('gvProduct'));"
            OnClick="btn_List_Click" />
        <asp:Button ID="btn_Delist" runat="server" Text="下架" OnClientClick="return acu.gv.checkMultiSelect(fixId('gvProduct'));"
            OnClick="btn_Delist_Click" />
        &nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="btn_EOAdd" runat="server" Text="增加" OnClick="btn_EOAdd_Click" />
        <asp:Button ID="btn_EOUpdate" runat="server" Text="修改" OnClientClick="return acu.gv.checkModify(fixId('gvProduct'));"
            OnClick="btn_EOUpdate_Click" />
        <asp:Button ID="btn_EODel" runat="server" Text="删除" OnClientClick="return acu.gv.checkDelete(fixId('gvProduct'));"
            OnClick="btn_EODel_Click" />
    </div>
    <fieldset>
        <legend>产品列表</legend>
        <asp:GridView ID="gvProduct" runat="server" AutoGenerateColumns="false" CssClass="GridView"
            DataKeyNames="ProductId" AllowPaging="True" PageSize="20" PagerSettings-Mode="Numeric"
            OnPageIndexChanging="gvProduct_PageIndexChanging">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <input id="CheckAll" onclick="return acu.gv.selectAll(this,event);" tabindex="0"
                            type="checkbox" title="点击全选或反全选当前页所有信息" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="cbxRow" runat="server" CausesValidation="False"></asp:CheckBox>
                    </ItemTemplate>
                    <ItemStyle Width="10px" />
                </asp:TemplateField>
                <asp:BoundField DataField="ProductNo" HeaderText="编号"></asp:BoundField>
                <asp:TemplateField HeaderText="名称">
                    <ItemTemplate>
                        <a href='Admin/Product/Edit.aspx?id=<%# DataBinder.Eval(Container, "DataItem.ProductId")%>'>
                            <%# DataBinder.Eval(Container, "DataItem.ProductName")%></a>
                    </ItemTemplate>
                    <ItemStyle />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="图片">
                    <ItemTemplate>
                        <img onclick='showAlbum(this)' pname='<%# DataBinder.Eval(Container, "DataItem.ProductName")%>'
                            pid='<%# DataBinder.Eval(Container, "DataItem.ProductId")%>' src='/Cellula_client/Default/Images/Product/icon_pic_sign1.png'
                            width="16" height="16" alt="" border="0" /><%# DataBinder.Eval(Container, "DataItem.PicCount")%>
                    </ItemTemplate>
                    <ItemStyle Width="30px" Font-Size="10px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="店铺">
                    <ItemTemplate>
                        <img onclick='showMarket(this)' pname='<%# DataBinder.Eval(Container, "DataItem.ProductName")%>'
                            pid='<%# DataBinder.Eval(Container, "DataItem.ProductId")%>' src='/Cellula_client/Default/Images/Product/icon_market_sign1.png'
                            width="16" height="16" alt="" border="0" /><%# DataBinder.Eval(Container, "DataItem.MarketCount")%>
                    </ItemTemplate>
                    <ItemStyle Width="30px" Font-Size="10px" />
                </asp:TemplateField>
                <asp:BoundField DataField="ProductModel" HeaderText="规格/型号"></asp:BoundField>
                <asp:BoundField DataField="CategoryName" HeaderText="分类"></asp:BoundField>
                <asp:BoundField DataField="ListDate" HeaderText="上架时间" ItemStyle-Width="60px"></asp:BoundField>
                <asp:BoundField DataField="DelistDate" HeaderText="下架时间" ItemStyle-Width="60px">
                </asp:BoundField>
                <asp:TemplateField HeaderText="在售状态">
                    <ItemTemplate>
                        <div class='sign_list_status<%# DataBinder.Eval(Container, "DataItem.ListStatus")%>'>
                        </div>
                    </ItemTemplate>
                    <ItemStyle Width="35px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="尺寸(米)">
                    <ItemTemplate>
                        <%# DataBinder.Eval(Container, "DataItem.Length")%>
                        *<%# DataBinder.Eval(Container, "DataItem.Width")%>
                        *<%# DataBinder.Eval(Container, "DataItem.Height")%>
                    </ItemTemplate>
                    <ItemStyle Font-Size="11px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="改色">
                    <ItemTemplate>
                        <div class='sign_yn<%# DataBinder.Eval(Container, "DataItem.IsColorable")%>'>
                        </div>
                    </ItemTemplate>
                    <ItemStyle Width="30px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="改尺">
                    <ItemTemplate>
                        <div class='sign_yn<%# DataBinder.Eval(Container, "DataItem.IsSizable")%>'>
                        </div>
                    </ItemTemplate>
                    <ItemStyle Width="30px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="编辑属性">
                    <ItemTemplate>
                        <a href='Admin/Product/Edit.aspx?id=<%# DataBinder.Eval(Container, "DataItem.ProductId")%>'
                            title="编辑基本属性">
                            <img src='/Cellula_client/Default/Images/sign_product_base_edit.png' width="16" height="16"
                                alt="编辑基本属性" border="0" /></a> <a href='Admin/Product/EditAtlInfo.aspx?id=<%# DataBinder.Eval(Container, "DataItem.ProductId")%>'
                                    title="编辑扩展属性">
                                    <img src='/Cellula_client/Default/Images/sign_product_atl_edit.png' width="16" height="16"
                                        alt="编辑扩展属性" border="0" /></a> <a href='Admin/Product/EditSaleInfo.aspx?id=<%# DataBinder.Eval(Container, "DataItem.ProductId")%>'
                                            title="编辑销售属性">
                                            <img src='/Cellula_client/Default/Images/sign_product_sale_edit.png' width="16" height="16"
                                                alt="编辑销售属性" border="0" /></a>
                    </ItemTemplate>
                    <ItemStyle Width="60px" Font-Size="10px" />
                </asp:TemplateField>
            </Columns>
            <PagerTemplate>
                <asp:LinkButton ID="lbnFirst" runat="Server" Text="首页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>'
                    CommandName="Page" CommandArgument="First"></asp:LinkButton>
                <asp:LinkButton ID="lbnPrev" runat="server" Text="上一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>'
                    CommandName="Page" CommandArgument="Prev"></asp:LinkButton>
                <asp:Label ID="lblPage" runat="server" Text='<%# "第" + (((GridView)Container.NamingContainer).PageIndex + 1)  + "页/共" + (((GridView)Container.NamingContainer).PageCount) + "页" %> '></asp:Label>
                <asp:LinkButton ID="lbnNext" runat="Server" Text="下一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>'
                    CommandName="Page" CommandArgument="Next"></asp:LinkButton>
                <asp:LinkButton ID="lbnLast" runat="Server" Text="尾页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>'
                    CommandName="Page" CommandArgument="Last"></asp:LinkButton>
            </PagerTemplate>
            <HeaderStyle CssClass="GridViewHeader" />
            <RowStyle CssClass="GridViewRow" />
            <FooterStyle CssClass="GirdViewFooter" />
            <AlternatingRowStyle CssClass="GirdViewAlternatingRow" />
            <PagerStyle CssClass="GridViewPager" />
            <EmptyDataRowStyle CssClass="GridViewEmptyDataRow" />
            <EmptyDataTemplate>
                没有可用的数据</EmptyDataTemplate>
        </asp:GridView>
    </fieldset>
</asp:Content>
